<template>
    <div>
        <h1>操作DOM元素</h1>
        <input ref="inputEl" placeholder="Focus on me!">
    </div>
</template>

<script setup>
import { ref, onMounted } from 'vue';

const inputEl = ref(null)

onMounted(() => {
inputEl.value.focus()
})
</script>

<style></style>